<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>

        class Person {
            constructor(name, age) {
                this.name = name;
                this.age = age;
            }
            say() {
                console.log('人')
            }
        }


        class Student extends Person {
            constructor(name, age, sex, score) {
                // 实现了构造函数和原型对象的组合继承
                super(name, age);
                this.sex = sex;
                this.score = score;
            }
            speak() {
                console.lo('学生')
            }
            // 实现方法的重载 --- 重写或者覆盖了父类的方法
            say() {
                console.log('6666')
            }
        }


        const s = new Student('cc', 18, 'nan', 100);
        console.log(s)
        s.say()

    </script>

</body>

</html>